package com.rupertjones.globalcron.client.messaging;

import org.apache.activemq.command.ActiveMQTextMessage;
import org.apache.log4j.Logger;

import javax.jms.JMSException;
import javax.jms.Message;

/**
 * <p>&copy Rupert Jones 2013</p>
 *
 * @author rup
 */
public class MessagesFromServerListener implements javax.jms.MessageListener {

    private static final Logger LOG = Logger.getLogger(MessagesFromServerListener.class);

    @Override
    public void onMessage(Message message) {
        try {
            LOG.info(((ActiveMQTextMessage) message).getText());
        } catch (JMSException e) {
            LOG.error(e);
        }
    }
}
